//-----------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------
/*
	Description:
		[en]	wrapper for libarchive
*/

#ifndef _UX_LIB_ARCHIVE_WRAP_H
#define _UX_LIB_ARCHIVE_WRAP_H

#ifndef UX_LIBARCHIVE_DISABLE


namespace libarchive
{
#	define LIBARCHIVE_STATIC

#	include "archive.h"
#	include "archive_entry.h"
}


#define LA_IS_OK( _ret )	((_ret) == ARCHIVE_OK)


namespace e_la_compression
{
	enum	type	: int
	{
		NONE				= ARCHIVE_COMPRESSION_NONE,
		GZIP				= ARCHIVE_COMPRESSION_GZIP,
		BZIP2				= ARCHIVE_COMPRESSION_BZIP2,
		COMPRESS			= ARCHIVE_COMPRESSION_COMPRESS,
		//PROGRAM			= ARCHIVE_COMPRESSION_PROGRAM,
		LZMA				= ARCHIVE_COMPRESSION_LZMA,
		XZ					= ARCHIVE_COMPRESSION_XZ,
		UU					= ARCHIVE_COMPRESSION_UU,
		RPM					= ARCHIVE_COMPRESSION_RPM,
	};
}


namespace e_la_format
{
	enum	type	: int
	{
		_MASK				= ARCHIVE_FORMAT_BASE_MASK,
		CPIO				= ARCHIVE_FORMAT_CPIO,
		CPIO_POSIX			= ARCHIVE_FORMAT_CPIO_POSIX,
		CPIO_BIN_LE			= ARCHIVE_FORMAT_CPIO_BIN_LE,
		CPIO_BIN_BE			= ARCHIVE_FORMAT_CPIO_BIN_BE,
		CPIO_SVR4_NOCRC		= ARCHIVE_FORMAT_CPIO_SVR4_NOCRC,
		CPIO_SVR4_CRC		= ARCHIVE_FORMAT_CPIO_SVR4_CRC,
		SHAR				= ARCHIVE_FORMAT_SHAR,
		SHAR_BASE			= ARCHIVE_FORMAT_SHAR_BASE,
		SHAR_DUMP			= ARCHIVE_FORMAT_SHAR_DUMP,
		TAR					= ARCHIVE_FORMAT_TAR,
		TAR_USTAR			= ARCHIVE_FORMAT_TAR_USTAR,
		TAR_PAX_INTERCHANGE	= ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE,
		TAR_PAX_RESTRICTED	= ARCHIVE_FORMAT_TAR_PAX_RESTRICTED,
		TAR_GNUTAR			= ARCHIVE_FORMAT_TAR_GNUTAR,
		ISO9660				= ARCHIVE_FORMAT_ISO9660,
		ISO9660_ROCKRIDGE	= ARCHIVE_FORMAT_ISO9660_ROCKRIDGE,
		ZIP					= ARCHIVE_FORMAT_ZIP,
		EMPTY				= ARCHIVE_FORMAT_EMPTY,
		AR					= ARCHIVE_FORMAT_AR,
		AR_GNU				= ARCHIVE_FORMAT_AR_GNU,
		AR_BSD				= ARCHIVE_FORMAT_AR_BSD,
		MTREE				= ARCHIVE_FORMAT_MTREE,
		RAW					= ARCHIVE_FORMAT_RAW,
		XAR					= ARCHIVE_FORMAT_XAR,
	};
}

#endif	// UX_LIBARCHIVE_DISABLE
#endif	// _UX_LIB_ARCHIVE_WRAP_H